package com.vue.admin.system.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.annotations.*;
import com.example.utils.Results;

/**
 * @Classname LoginController
 * @Description TODO
 * @Date 2022/8/20 10:28
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@Auth
@RestController("/vue-admin/user")
public class LoginController {


    @PostMapping("/login")
    public JSONObject loginController(@Param("username")String username,
                                      @Param("password")String password){
        String str="{\"code\":20000,\"data\":{\"token\":\"admin-token\"}}";
        JSONObject jsonObject=JSONObject.parseObject(str);
        return jsonObject;
    }

    @GetMapping("/info")
    public JSONObject userInfo(){
        String str="{\"code\":20000,\"data\":{\"roles\":[\"admin\"],\"introduction\":\"I am a super administrator\",\"avatar\":\"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif\",\"name\":\"Super Admin\"}}";
        JSONObject object=JSONObject.parseObject(str);
        return object;
    }
}
